package com.cc.study.scope;

import com.cc.study.ioc.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestScope {

    @Test
    public void demo01(){
        String xmlPath = "scope.xml";
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);
        UserService userService1 = (UserService) applicationContext.getBean("userServiceId");
        UserService userService2 = (UserService) applicationContext.getBean("userServiceId");
        System.out.println(userService1);
        System.out.println(userService2);
    }
}
